package com.smartum.mpr.client.presenter;

import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.ui.HasWidgets;

/**
 * Interface for all presenters, which register <code>go</code> and <code>bind</code> methods.
 * <p/>
 * <ul>
 * <li>go methods draw UI in the parent panel</li>
 * <li>bind method add handlers to the {@link com.google.gwt.event.shared.HandlerManager eventBus} and add listeners
 * to the controls</li>
 * </ul>
 */
public interface Presenter {

    /**
     * Method add handlers to the {@link com.google.gwt.event.shared.HandlerManager eventBus} and add listeners
     * to the controls.
     */
    void bind();

    /**
     * {@link HandlerManager} is a main part of each presenter, because it is responsible for the event handling.
     *
     * @return
     */
    HandlerManager eventBus();
}
